package com.CST.entity.zx;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.baomidou.mybatisplus.annotation.*;

import java.time.LocalDateTime;

import java.io.Serializable;
import java.util.Objects;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import com.alibaba.excel.annotation.ExcelProperty;

/**
 * @author ly
 * @since 2023-03-07
 */
@ApiModel(value = "科目关系对照")
@Data
@TableName("ZX_EXPENSE_TYPE")
public class ZxExpenseType implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "费用类别id")
    @ExcelIgnore
    @TableId(value = "id",type = IdType.AUTO)
    private Long id;

    @ApiModelProperty(value = "科目编码")
    @ExcelProperty("科目编码")
    private String accountCode;

    @ApiModelProperty(value = "科目名称")
    @ExcelProperty("科目名称")
    private String accountName;

    @ApiModelProperty(value = "项目类别编号")
    @ExcelProperty("项目类别编号")
    private Long projectTypeCode;

    @ApiModelProperty(value = "项目类别名称")
    @ExcelProperty("项目类别名称")
    private String projectTypeName;

    @ApiModelProperty(value = "费用类别编号 ")
    @ExcelProperty("费用类别编号")
    private Long expenseTypeCode;

    @ApiModelProperty(value = "费用类型名称")
    @ExcelProperty("费用类型名称")
    private String expenseTypeName;

    @ApiModelProperty(value = "收支类型编号 ")
    @ExcelProperty("收支类型编号")
    private Long reExTypeCode;

    @ApiModelProperty(value = "收支类型名称")
    @ExcelProperty("收支类型名称")
    private String reExTypeName;

    @ApiModelProperty(value = "冗余字段")
    @ExcelIgnore
    private Long fourthDictCode;

    @ApiModelProperty(value = "冗余字典名")
    @ExcelIgnore
    private String fourthDictName;

    @ApiModelProperty(value = "冗余字典")
    @ExcelIgnore
    private Long fifthDictCode;

    @ApiModelProperty(value = "冗余字典名")
    @ExcelIgnore
    private String fifthDictName;

    @ApiModelProperty(value = "创建人工号")
    @ExcelProperty("创建人工号")
    private String createuserId;

    @ApiModelProperty(value = "创建时间")
    @ExcelProperty("创建时间 格式2023-04-03 13:31:07")
    private LocalDateTime createtime;

    @ApiModelProperty(value = "更新时间")
    @ExcelIgnore
    private LocalDateTime updatetime;

    @ApiModelProperty(value = "更新人id")
    @ExcelIgnore
    private String updateuserId;

    @ApiModelProperty(value = "逻辑删除")
    @ExcelIgnore
    private Integer isDeleted;

    @TableField(exist = false)
    @ExcelIgnore
    @ApiModelProperty(value = "第几页")
    private Integer pageNo;

    @TableField(exist = false)
    @ExcelIgnore
    @ApiModelProperty(value = "一页几条数据")
    private Integer pageSize;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        ZxExpenseType that = (ZxExpenseType) o;
        return Objects.equals((accountCode+projectTypeCode), (that.accountCode+projectTypeCode));
    }

    @Override
    public int hashCode() {
        return Objects.hash((accountCode+projectTypeCode));
    }
}
